﻿@model VisaApp.Models.HotrotructuyenModel
@{  AjaxOptions ajaxOpts = new AjaxOptions
    {
        HttpMethod = "post",
        OnComplete = "completedAjaxRequestCategoeyChauLuc"
    };
}

<script type="text/javascript">

    function completedAjaxRequestCategoeyChauLuc(obj) {

        var returnObj = eval('(' + obj.responseText + ')');

        if (returnObj.Status == "success") {
            if (returnObj.Message != null) {
                makeSuccessHighlightChauLuc(returnObj.Message);
            }
            else if (returnObj.RedirectUrl != null) {
                window.location.href = returnObj.RedirectUrl;
            }
        } else {
            makeErrorHighlightChauLuc(returnObj.Message);
        }

        return false;
    }

    function makeErrorHighlightChauLuc(messageStr) {
        var $highlight = $("<div style='padding: 0.7em; margin-bottom:5px; width: inherit;'><p><span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em;'></span><strong>Alert: </strong>" + messageStr + "</p></div>");
        $highlight.addClass("ui-state-highlight ui-corner-all");
        $highlight.prependTo(".warning-area");
        $highlight.delay(4000).fadeOut(500);
    }

    function makeSuccessHighlightChauLuc(messageStr) {
        var $highlight = $("<div style='padding: 0.7em; margin-bottom:5px; width: inherit;'><p><span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span><strong>Success: </strong>" + messageStr + "</p></div>");
        $highlight.addClass("ui-state-highlight ui-corner-all");
        $highlight.prependTo(".warning-area");
        $highlight.delay(4000).fadeOut(500);
    }

</script>
@using (Ajax.BeginForm("EditHotrotructuyen", "Quantri", null, ajaxOpts, new { enctype = "multipart/form-data" }))
{
    <div class="section-header">
        <div class="options">
            <button type="submit" name="save" value="save" class="t-button">
                Save</button>
        </div>
    </div>
    <div id="tabasAddCategory">
        <ul>
            <li><a href="#tabs-1">Thông tin</a></li>
        </ul>
        <div id="tabs-1">
            <table>
                <tr>
                    <td colspan="2">
                        @Html.HiddenFor(model => model.Id, new { id = "Id" })
                        @Html.HiddenFor(model => model.DateCreate)
                        @Html.HiddenFor(model => model.Detele)
                        <div class="warning-area">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Name, "Tên người hỗ trợ"):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => Model.Name, new { @style = "width:300px" })
                        @Html.ValidationMessageFor(model => model.Name)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Nick, "Nick Skype"):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => Model.Nick, new { @style = "width:300px" })
                        @Html.ValidationMessageFor(model => model.Nick)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.NickYahoo, "Nick Yahoo"):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => Model.NickYahoo, new { @style = "width:300px" })
                        @Html.ValidationMessageFor(model => model.NickYahoo)
                    </td>
                </tr>
                 <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Email, " Email"):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => model.Email, new { @style = "width:300px" })
                        @Html.ValidationMessageFor(model => model.Email)
                    </td>
                </tr>
                 <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Dt, " Điện thoại "):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => model.Dt, new { @style = "width:300px" })
                        @Html.ValidationMessageFor(model => model.Dt)
                    </td>
                </tr>
            </table>
        </div>
       
    </div>
    
}
